<?php
namespace Service;

use Library\Redis;
use Model\Card;


/**
 * CardService
 * @author los_gsy
 */
class CardService extends BaseService {
	/**
	 * 构造函数
	 */
	public function __construct() {
		parent::__construct();
	}


	/**
	 * test
	 */
	static public function test() {
		return __METHOD__;
	}


	/**
	 * placeOrder
	 */
	static public function placeOrder() {
		$redis_key = 'card:code:new';
		$cardCode = Redis::rpop($redis_key);
		$data = [];
		$data['sold'] = 1;
		Card::saveCardByCode($data, $cardCode);
		return $cardCode;
	}





}